package com.cpecc.manager.wuzi;

import com.cpecc.dao.wuzi.WuZiDao;
import com.cpecc.model.system.Dep;
import com.cpecc.model.system.User;
import com.cpecc.model.wuzi.WuZi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class WuZiManager {

	@Autowired
	private WuZiDao wuZiDao;

	public boolean updateDepByUserId(User user) {
		return wuZiDao.updateDepByUserId(user);
	}
	
	public List<WuZi> getMyWuZi(User user){
		return wuZiDao.getMyWuZi(user);
	}
	
	public void save(WuZi wuZi){
		wuZiDao.save(wuZi);
	}
	
	public int getNo(WuZi wuZi){
		return wuZiDao.getNo(wuZi);
	}
	
	public boolean cover(WuZi wuZi){
		return wuZiDao.cover(wuZi);
	}
	
	public WuZi get(String id){
		return wuZiDao.get(id);
	}
	
	public boolean quChuDiuShi(){
		return wuZiDao.quChuDiuShi();
	}
	
	public boolean stopPanDian(){
		return wuZiDao.stopPanDian();
	}
	
	public List<WuZi> listStop(){
		return wuZiDao.listStop();
	}
	
	public List<WuZi> getYiChangList(WuZi wuZi,String depId,String userId){
		return wuZiDao.getYiChangList(wuZi, depId, userId);
	}
	
	public void faQiPanDian(){
		wuZiDao.faQiPanDian();
	}
	
	public void danDuPanDian(String id){
		wuZiDao.danDuPanDian(id);
	}
	
	public List<User> getPanDianYH(){
		return wuZiDao.getPanDianYH();
	}
	
	public List<WuZi> getPanDianWuZi(){
		return wuZiDao.getPanDianWuZi();
	}
	
	public List<WuZi> getMyPanDian(User user){
		return wuZiDao.getMyPanDian(user);
	}
	
	public List<WuZi> getMyListCX(WuZi wuZi,User user,String wuZiLBId,int wuZiZTId){
		//return wuZiDao.getMyListCX(wuZi, user, wuZiLBId, wuZiZTId);
		return wuZiDao.getMyWuZiList(wuZi, user, wuZiLBId, wuZiZTId);
	}

	public List<WuZi> getWuZiList(WuZi wuZi, String wuZiLBId, int[] shiYongZTId){
		return getWuZiList(wuZi, wuZiLBId, shiYongZTId, null, null);
	}

	public List<WuZi> getWuZiList(WuZi wuZi, String wuZiLBId, int shiYongZTId){
		return getWuZiList(wuZi, wuZiLBId, new int[] {shiYongZTId}, null, null);
	}

	public List<WuZi> getWuZiList(WuZi wuZi,String wuZiLBId, int shiYongZTId, String depId, String userId){
		return getWuZiList(wuZi, wuZiLBId, new int[]{shiYongZTId}, depId, userId);
	}

	public List<WuZi> getWuZiList(WuZi wuZi,String wuZiLBId, int[] shiYongZTId, String depId, String userId){
		return wuZiDao.getWuZiList(wuZi, wuZiLBId, shiYongZTId, depId, userId);
	}

	public List<WuZi> getKuCunListCX(WuZi wuZi,String wuZiLBId){
		return wuZiDao.getKuCunListCX(wuZi, wuZiLBId);
	}
	
	public List<WuZi> getAllWuZiListCX(WuZi wuZi,String wuZiLBId,int wuZiZTId,String shiYongdepId,String shiYonguserId){
		return wuZiDao.getAllWuZiListCX(wuZi, wuZiLBId, wuZiZTId, shiYongdepId, shiYonguserId);
	}
	
	public int getBianHao(String qianZhui){
		return wuZiDao.getBianHao(qianZhui);
	}
	
	public List<WuZi> getBuMenWuZiListCX(Dep dep,WuZi wuZi,String wuZiLBId,int wuZiZTId){
		return wuZiDao.getBuMenWuZiListCX(dep, wuZi, wuZiLBId, wuZiZTId);
	}
	
	public List<WuZi> getAll(){
		return wuZiDao.getAll();
	}
	
	public List<WuZi> getAllBaoFeiKu(WuZi wuZi,String wuZiLBId){
		return wuZiDao.getAllBaoFeiKu(wuZi, wuZiLBId);
	}	
	
	public WuZi getByZiChanBH(String ziChanBH){
		return wuZiDao.getByZiChanBH(ziChanBH);
	}
	
	public List<WuZi> inUseList(User user){
		return wuZiDao.inUseList(user);
	}
	
	public boolean delete(String id){
		return wuZiDao.delete(id);
	}
	
	public List<WuZi> panDianList(){
		return wuZiDao.panDianList();
	}
}
